package com.example.demospring5.primary.lifecircle;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * 生命周期注解
 * <InitializingBean 接口， DisposableBean接口 />
 * @author cool
 * @date 2022/07/31
 */
@Component
public class LifecycleAnnotationInterface {
    @PostConstruct
    public void populateMovieCache() {
        // populates the movie cache upon initialization...

        System.out.println("Lifecycle生命周期注解- @PostConstruct======");
    }

    @PreDestroy
    public void clearMovieCache() {
        // clears the movie cache upon destruction...
        System.out.println("Lifecycle生命周期注解- @PreDestroy======");
    }
}
